// The Vue build version to load with the `import` command
// (runtime-only or standalone) has been set in webpack.base.conf with an alias.
import Vue from 'vue'
import App from './App'
import router from './router'
import VueLazyLoad from 'vue-lazyload'
import infiniteScroll from 'vue-infinite-scroll'
import store from './store'
import { currency } from '@/util/currency'

Vue.filter('currency', currency) // 全局过滤器 价格格式化 $2,018.00

Vue.use(infiniteScroll)
Vue.use(VueLazyLoad, {
  loading: '/static/loading-svg/loading-balls.svg'
})

Vue.config.productionTip = false

/* eslint-disable no-new */
new Vue({
  el: '#app',
  router,
  store,
  components: { App },
  template: '<App/>',
  mounted() {
    this.$store.dispatch('userInfo/checkLogin')
    this.$store.dispatch('cart/getCartCount')
  }
})
